import 'package:flutter/material.dart';
import 'package:hi_flutter/app_page.dart';
import 'animated_logo.dart';

class AnimatePage2 extends StatefulWidget {
  const AnimatePage2({Key? key}) : super(key: key);

  @override
  AnimatePage2State createState() => AnimatePage2State();
}

class AnimatePage2State extends State<AnimatePage2>
    with SingleTickerProviderStateMixin {
  late AnimationController controller;
  late Animation<double> animation;

  @override
  initState() {
    super.initState();
    controller = AnimationController(
        duration: const Duration(milliseconds: 2000), vsync: this);
    animation = Tween(begin: 0.0, end: 300.0).animate(controller);
    controller.forward();
  }

  @override
  Widget build(BuildContext context) {
    return AppPage(
      body: AnimatedLogo(animation: animation),
    );
  }

  @override
  dispose() {
    controller.dispose();
    super.dispose();
  }
}
